<template>
  <div v-html="formContent"></div>
</template>

<script>
export default {
    data() {
        return {
            formContent: "",
        }
    },
    created() {
      this.$api.payUnFinishOrder(this.$route.query.order_num).then(ret=> {
        if(ret.status) {
          this.formContent = ret.data;
          // 在 vue 中打开 支付页面
          this.$nextTick(() => {
            document.forms[0].submit();
          })
        }else{
           this.$toastr.error(ret.message, "2秒后自动关闭该窗口",  {
             timeOut: 2000, onHidden: () => {
               // 支付出现参数异常，则自动关闭该弹出的窗口
               window.close() ;
             }
           })
        }
      });
    }
}
</script>